Skip to content

[docs] Full screen demos in new tab #46088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

cherniavskii
Copy link
Member

@cherniavskii cherniavskii commented May 5, 2025

@cherniavskii cherniavskii added docs Improvements or additions to the documentation enhancement This is not a bug, nor a new feature labels May 5, 2025
@mui-bot
Copy link

mui-bot commented May 5, 2025

Netlify deploy preview

https://deploy-preview-46088--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 3765168

@oliviertassinari oliviertassinari added the scope: docs-infra Specific to the docs-infra product label May 5, 2025
@cherniavskii cherniavskii marked this pull request as ready for review May 7, 2025 11:53
@@ -127,6 +127,7 @@ export default withDocsInfra({
{
loader: require.resolve('@mui/internal-markdown/loader'),
options: {
enableOpenInNewTab: true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it opt-in; the "Open in new tab" button in the demo toolbar is not shown by default.
But the ?scopedDemo URL is supported regardless of this setting.

I don't know if the Core wants to have this enabled for the whole repo.
You can disable enableOpenInNewTab and enable it for specific pages like this:

import * as pageProps from 'docs/data/material/components/drawers/drawers.md?muiMarkdown';

export default function Page() {
  return <MarkdownDocs {...pageProps} enableOpenInNewTab />;
}

This could be particularly useful for pages like https://mui.com/material-ui/react-drawer/

Let me know if you have a preference for this setting, and I'll update the PR accordingly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume it's a question for @DiegoAndai

@cherniavskii cherniavskii requested a review from a team May 7, 2025 12:02
Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mui/docs-infra To give a second opinion on the changes with getLayout. I think I covered all cases, but I'm not sure I found the reason why it was built this way in the first place.

Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kind of remember that the getLayout was for some performances improvement when moving from one page to another.

The NextJS.render takes +100ms after this PR

@siriwatknp do you have more insight on this aspect?

@alexfauquette alexfauquette requested a review from siriwatknp May 27, 2025 08:29
@cherniavskii
Copy link
Member Author

The NextJS.render takes +100ms after this PR

@alexfauquette Where did you get this information from? 🤔

@alexfauquette
Copy link
Member

Where did you get this information from? 🤔

The Chrome performance measures when I click on another page

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation enhancement This is not a bug, nor a new feature scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants